package com.sanbi.shield.server.controller;

import com.sanbi.shield.common.repsonse.CommonResponse;
import com.sanbi.shield.server.biz.service.UserInfoService;
import com.sanbi.shield.server.common.bean.vo.UserInfoPdaVO;
import com.sanbi.shield.server.shield.ShieldUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * PDA用户信息Controller
 *
 * @author XiaoQingqing
 * @since 2024/08/08
 */
@Validated
@RestController
@RequestMapping("/pda/user/info")
@Api(value="PDA用户信息Controller", tags={"PDA用户信息"})
public class UserInfoPdaController {
    /**
     * 用户信息Service
     */
    @Resource
    private UserInfoService userInfoService;

    @GetMapping("/current")
    @ApiOperation(value = "当前用户信息查询")
    public CommonResponse<UserInfoPdaVO> queryCurrentUserInfo() {
        Long userId = ShieldUtils.getUserId();
        return CommonResponse.ok(userInfoService.queryPdaUserInfo(userId));
    }

}
